package com.xianggu.designMode.combination.demo02;

// ================ 业务对象 ================
public class Graphic {
    private int x, y;
    private double rotation;

    public void move(int dx, int dy) {
        x += dx;
        y += dy;
        System.out.println("图形移动到 (" + x + ", " + y + ")");
    }

    public void rotate(double angle) {
        rotation += angle;
        System.out.println("图形旋转至 " + rotation + " 度");
    }

    // Getters and Setters
    public int getX() { return x; }
    public int getY() { return y; }
    public void setPosition(int x, int y) {
        this.x = x;
        this.y = y;
    }
    public double getRotation() { return rotation; }
    public void setRotation(double rotation) { this.rotation = rotation; }
}
